#!/usr/bin/env bash
# find crlf in current folder

set -e

if [[ $1 == '--fix' ]];
then
  grep -IUrl --color $'\r' ${1:-.} | grep -v '.git/' | xargs -I{} dos2unix {}
else
  grep -IUrl --color $'\r' ${1:-.} | grep -v '.git/'
fi
